You are here: About the advanced features > VBScript examples > Transferring ownership upon release

Transferring ownership upon release

Many customers use the Global Collaboration Framework to transfer ownership of as-built documents from the owner/operator's site to a different site (possibly managed by a separate department or contractor) for design work to be performed. When the documents are released from design workflows at the remote site, document ownership is returned to the owner/operator site unless the release is only for design review by the owner/operator. This is done by adding code similar to the following to the DocWorkflowEvent_AfterChangeWFState event handler:

Sub DocWorkflowEvent_AfterChangeWFState (Batch, SourceState, destinationState, Person, Comment)
  If Document.DocumentType.InternalName = "Drawing" Then
    If destinationState = AS_WF_RELEASED And User.HasRole ("Manager") Then
      If WinMsgBox ("Is this release for review?", AS_YesNo) = AS_Yes Then
       'Check if the document was transferred to the owner site before. 'If so, no further action is necessary. The Global Collaboration Framework will automatically 'transfer the updates and release the assembly.
        If Instr (Document.GCFCollaboratingShares, "Operator") = 0 Then
       GCFInitiateTransfer "Operator", False, True, True, _
          "manager@company.com ", "Drawing " & Document.FileName & " released for review."
        End If
      End If
    End If
  End If
End Sub

When the document being transferring has incoming references from other documents (for example, a specifications document references an assembly), the referenced document is replicated only when it is also present in the same briefcase. With 3D CAD applications, this will automatically happen because adding a component to an assembly will update the assembly document. Because the document is updated, the GCF will include it in the briefcase.

When a reference is created without updating the content of the referenced document, you need to force inclusion of the referenced document as shown in the following example:

Document.GCFLastPropertyUpdate = Today

Related concepts

Centralizing sequence number generation

Understanding table data replication

Understanding document ownership

Understanding ownership transfers

Cross-site workflow implementation

Understanding claim ownership transfers

Related tasks

Calculating import notification messages

UpdateTable example

Executing remote script functions

Calculating document names

Requesting a document name

Handling hub vault unavailability

Enlisting all sites for new documents

Customizing site delistment

Related information

GCF privileges

GCFInitiateTransfer function

InitiateTransfer function

RequestOwner function